import { Logger } from "../../engine/Logger";
import RandomUtil from "../../engine/RandomUtil";
import ResourcesManager from "../../engine/ResourceManager";

export class NickNameConfig {

    public static Config_Name: string = "nickname"
    public static Res_Path: string = "config/txt/nickname"


    private static nameConfigList: Array<string> = []

    public static resource2Config(resource: cc.TextAsset) {
        this.nameConfigList = resource.text.split("\r\n")
        // Logger.log("NickNameConfig==", this.nameConfigList)
        ResourcesManager.instance.release(this.Res_Path)
    }

    public static randomName() {
        return RandomUtil.randomItem(this.nameConfigList)
    }

}